﻿#ifndef _OI_PLSCANNER_COMMAND_HPP_
#define _OI_PLSCANNER_COMMAND_HPP_

#include<vector>
namespace Oi
{
    namespace PLScannerCore
    {

        class OI_PLSCANNER_CORE_API BalanceCommand : public QObject
        {
            Q_OBJECT
        public:
            //static std::vector<Command*> commands;
            enum CommandType
            {
                NoProcess = 0,
                Tooldel = 1,
                Crop,
                Tooladd,
                Flip,
                Rotate,
                Loadfile,
                Acquire,
            };

        public:
            BalanceCommand();
            
            virtual QString name() { return QString(); }

            virtual CommandType type() { return NoProcess; }

            virtual void run() {};

            virtual bool isRetoEnabled() { return false; }

            virtual void reto();
        };

        typedef QSharedPointer<BalanceCommand> CommandPtr;


        class OI_PLSCANNER_CORE_API CommandSystem : public QObject
        {
            Q_OBJECT
        public:
            CommandSystem();
            ~CommandSystem();

        public:
            void clear();
            void append(const int type, const QVariant& var);
            void append(CommandPtr);
            void redo();

            void setMaxStorage(int);
            int maxStorage() const;

        signals:
            void redoInfo(bool, QString = QString());


        private:
            OI_DISABLE_COPY(CommandSystem);
            OI_DECLARE_IMPL(CommandSystem);

        };
    }
}
#endif

